package com.zrgj.front.config;

import org.springframework.context.annotation.Configuration;

import java.io.FileWriter;
import java.io.IOException;
@Configuration
public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2016092000557027";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQChHq31lRGd9bz+/MndjUt0Brh/PPCqekwsvpKPxIWa+AyzrKX3LfBfd3VoGvXY7rCf8aG0vF3GF+EPUwlyxtoOtLYf8HdawbLB2CpubJd1YHzUgOwZQOIKGJ5IeSedgwfvDUH1QHH32WcAjb+5eCYaFrt8hzj4qURPSIq43YKhUjYCDR0Ti1bVJ/aLBsUKJrekzZEHSTxHW73Gl9dHev8kcG3QQo0W8LsJLOUSbLmIkD8jhn18+PrIkx2CWkCYthzxuR3O85uHuM0vKmVuAL1nUOIS3w590GS5kxl7stG/T/vqh4XqD1A3TsrBEorjY1M6CePUzu7BAurpopX0R4HVAgMBAAECggEBAJFl5ErI+Zr41lOtwGXlSoAsSHbagbz2nKOMXyrKiF9vFddXKHbFyDP+077dBZt823ubTPiTPHS1u+5eWxpvBP1cazarhKosPqrb7n60FIJiToRey7GGcfX2fXCdlPh59MDvz+QJAlBOqrs/MBOpr4i/lvYr+We9KN37cuSdUXNOE7+mm0IA+MP0q/gEsrlmpYHiqY/c56h+vPW0VMfkK7i2nQ7bDY/BhdbF+tI800cNgnxVJ3gXl0GF+DXM00zZWTAGcuTtNsxTltUICq2UlyvGxV3VbCD15P51kq2sRCSV1+bQ7Er4sCfaxn08bHbTU6h3RhLdZhRFhF6+eEU0i0ECgYEA2xBbU0sAFq9v+zypCvy/SkuAoZVojajH4jkQLdS5X+/IGCfYZtXA0cqi7ndQowj1ojGagViawRedgjBb4v8hRnlEpstNYz0aco0xf1uaUZ3MdSqEz4mOfhEzJqpJdzpVNAT2kp9cFSdYyBHsv3TjI/6o0bWA3jyOmcKh3OVfcqkCgYEAvEk73ZIoqyMFJJs2a5D+v/YmUXnU4Df/XT5PxPWsiyBAUfastCICFP8DgKSVB7Q1vf+lGeiWA8USwaV6ftYIBU7tooBw/QbZUA9F/eFwQs1/9BGb5tlOxATdeNMzEMY6fI8+DbSFSE4vNOd1VDno2NxUGZ5nDbbDP/vwSYnZ/U0CgYAc2LyN7VRnqFaAqO5BqiKub97SaFBKRy17FrSQtHBst7CLrcOLVx57AcoOyNtvfKCL6ShFXBuUzb1KBYA0FhCVrSZjKGZaaRNwfjNEaBWcJcFktGKkyaJf63fm4YmnD6Fkpjqp+B4yEupX/jREyemXNdOZOeNsYGEO0lhqNDIrcQKBgGK6E8XuqZxy1HOJX1Ovx6RoMVdvhou7UQ9XaQRhvYOF+bQAoDYjzuure+6sXeiYOcXSkoOvTVnUsC0R09VF7Ra7eCdJKfXC7ZfpKk4hM3gTwQ/9W74EHCT0WBzOwWv+RRSjF2qgSXLMbDxVUVREuS9c+Ewmnuq19lNKi4hD3CXRAoGBAIon3CqiWPMDesP3IqRTgFNqlDotXfz5MmKjIeMnkXxAZGVEbeX4q89trDc7rxuqu0JZ2QLc2kIoPZcOG7FiKc3YPy58My+Wx3fksnmBLLzzFuWKVW2211l2tZKZ0GlVbABIyLPAS8GRobpo3HwVGmFq1MlrkQxKLPJnuk6VraJB";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvgD4L1UvFKP3tpvo7xOJNvfC4Ra6/IXkylewMbbU0vFGN00Kfiqw+kv1pP7T3QkKluWDUdRnGpHm8c5EB3HAYCVboop70m2wwUao9tmr0qoNm3YjPt0vCr/3QHK5wIgd2BNpzNMvi08sv1Hfjs/tFtxNnDg3uPvC/XasQbup7GtIZ2+58HqHlS14K1jey5CIXHmvNt3t9q1kwfPuZcxbGEF0DKBeW2RAvamLD/G30vSpCdZxDLJ9JI00UarvJCs4EkXbAx1CNvV0N6AXbwgLtKuCx4FkAgkHaJKjmJvoYOzrcW/xkT/7tmebKJUK14YORzNWyJ3TzHP2O+2AxexObwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问，
    public static String notify_url = "http://localhost:8083/notify_url";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:8083/user/user_index.html";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "D:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
